package com.ljy.my_study.java;

/**
 * @author lijunying
 * @date 2021/2/22 8:37
 */
public class ForEachBreakTestMain {

    public static void main(String[] args) {
//        int COUNT_BITS = Integer.SIZE - 3;
//        int CAPACITY   = (1 << COUNT_BITS) - 1;
//        System.out.println(COUNT_BITS);
//        System.out.println(Integer.toBinaryString(CAPACITY));
//        System.out.println(Integer.toBinaryString(~CAPACITY));

        print(1);
    }

    //跳出某个if判断
    public static void print(int num){
        out: if(num<10){
            mid:if(num<5){
                if(num%2==0){
                    System.out.println("break mid");
                    break mid;
                }else
                    mid2: if(num<3){
                        if(num==1){
                            System.out.println("break mid2");
                            break mid2;
                        }
                        System.out.println("mid2");
                    }
                System.out.println("mid");
            }
            System.out.println("out");
        }
    }
}
